package com.zsd.android.camerax.adapter

import android.content.Context
import android.graphics.Typeface
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import com.zsd.android.camerax.R
import com.zsd.android.common.BaseRvAdapter
import com.zsd.android.common.BaseViewHolder

class HomeAdapter(mContext: Context, list: ArrayList<String>) :
    BaseRvAdapter<String>(mContext, list) {

    var textStyles: Int = Typeface.NORMAL

    override fun createHolder(parent: ViewGroup, viewType: Int): BaseViewHolder {
        var view = mInflater.inflate(R.layout.item_home_layout, parent, false)
        return BaseViewHolder(view)
    }

    override fun bindView(holder: BaseViewHolder, position: Int) {
        var date = list.get(position)
        holder.setText(R.id.item_home_content, date)
        holder.getView<TextView>(R.id.item_home_content).setTypeface(null, textStyles)
    }
}